<body>

<p>
  KIE provides a knowledge-centric API, where rules and processes are first class citizens. The majority of KIE API
  is considered stable and should not change, experimental classes and APIs will be marked as such.
</p>

<p>
  The most common interfaces you will use are:
<ul>
  <li><code>org.kie.api.KieBase</code></li>
  <li><code>org.kie.api.runtime.KieSession</code></li>
  <li><code>org.kie.api.runtime.StatelessKieSession</code></li>
  <li><code>org.kie.api.runtime.KieContainer</code></li>
  <li><code>org.kie.api.builder.ReleaseId</code></li>
  <li><code>org.kie.api.builder.KieScanner</code></li>
</ul>
</p>

<p>
  Factory classes, with static methods, provide instances of the above interfaces. A pluggable provider approach is used
  to allow provider implementations to
  be wired up to the factories at runtime. The Factories you will most commonly use are:
<ul>
  <li><code>org.kie.api.KieServices</code></li>
  <li><code>org.kie.api.command.KieCommands</code></li>
  <li><code>org.kie.api.io.KieResources</code></li>
</ul>
</p>

<p>
  Typical example of loading and using knowledge resources (rules, processes, etc) found on classpath. By convention the
  KIE API expects file <code>META-INF/kmodule.xml</code> which is a marker file and also enables additional configuration.
  For very basic usage the file can just contain <code>&lt;kmodule xmlns="http://www.drools.org/xsd/kmodule"/&gt;</code>:
<pre>
  KieServices kieServices = KieServices.Factory.get();
  KieContainer kieContainer = kieServices.getKieClasspathContainer();
  KieSession kieSession = kieContainer.newKieSession();
  try {
    kieSession.insert(new Fibonacci(10));
    kieSession.fireAllRules();
  } finally {
    kieSession.dispose();
  }
</pre>
</p>

<p>
  Drools 8 introduced Rule Unit API as a recommended style which provides an atomic module defining a set of rules and a set of strongly typed
  data sources:
<pre>
  MeasurementUnit measurementUnit = new MeasurementUnit();
  RuleUnitInstance&lt;MeasurementUnit&gt; instance = RuleUnitProvider.get().createRuleUnitInstance(measurementUnit);
  try {
    measurementUnit.getMeasurements().add(new Measurement(&quot;color&quot;, &quot;red&quot;));
    List&lt;Measurement&gt; queryResult = instance.executeQuery(&quot;FindColor&quot;).stream().map(tuple -&gt; (Measurement) tuple.get(&quot;$m&quot;)).collect(toList());
  } finally {
    instance.dispose();
  }
</pre>
</p>

</body>
